package org.springframework.context.support;

import org.springframework.beans.factory.FactoryBean;
import org.springframework.core.convert.support.StringToLocalDateConverter;

import java.util.HashSet;
import java.util.Set;

/**
 * @Name ConvertersFactoryBean
 * @Description: 类型转换器集合工厂加工 Bean [实现] 类
 * @Version v1.0.0
 * @Author: lichao
 * @Date: 2024-04-11 18:12:40
 **/
public class ConvertersFactoryBean implements FactoryBean<Set<?>> {
    @Override
    public Set<?> getObject() throws Exception {
        Set<Object> converters = new HashSet<>();
        StringToLocalDateConverter stringToLocalDateConverter = new StringToLocalDateConverter("yyyy-MM-dd");
        converters.add(stringToLocalDateConverter);
        return converters;
    }

    @Override
    public boolean isSingleton() {
        return true;
    }
}

